class CreateUsers < ActiveRecord::Migration
  def self.up
    create_table :users, :force => true do |t|
      t.string :username, :null => false, :limit => 32
      t.string :email, :null => false, :limit => 128
      t.string :hashed_password, :limit => 128
      t.string :salt, :limit => 64
      t.string :reset_password_code, :limit => 64
      t.string :activation_code, :limit => 64
      t.string :remember_token, :limit => 128
      t.datetime :remember_token_expires_at
      t.string :status, :null => false, :default => "passive", :limit => 32
      t.datetime :activated_at
      t.datetime :suspended_at
      t.datetime :deleted_at

      t.timestamps
    end

    add_index :users, :username, :unique
    add_index :users, :email
    # :hashed_password, :activation_code, :remember_token ?
  end

  def self.down
    drop_table "users"
  end
end
